﻿using Common.Helpers;
using Common.HelpersXMLHelper;
using GptChatBatch.WinUI.Configs;
using GptChatBatch.WinUI.Forms;
using GptChatBatch.WinUI.Tests;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GptChatBatch.WinUI
{
    public partial class FrmMain : Form
    {
        public FrmMain()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            new FrmChatGpt().Show();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            new FrmChatGptBatch().Show();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            //string v = AppConfigIni.ReadValue("Logging", "Level");
            //textBox1.Text=v;
            //Log4Helper.Debug(v);
            //Log4Helper.Info(v);
            //Log4Helper.Error(v);

            //创建XML文件帮助类实例
            XMLFileHelper xml = new XMLFileHelper(@"test.xml");

            //添加节点
            Dictionary<string, string> attributes = new Dictionary<string, string>();
            attributes.Add("Id", "1");
            xml.Add("//Root", "Person", "Tom", attributes);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            string val = textBox1.Text;
            AppConfigIni.WriteValue("Logging", "Level", val);
        }

        private void button5_Click(object sender, EventArgs e)
        {
            new TestForm1().Show(); 
        }

       
    }
}
